Fixed findings

List of Findings

Error: CPPCHECK_WARNING (CWE-401): [#def1]
libimobiledevice-1.3.0_20230705git6fc41f5-build/libimobiledevice-6fc41f57fc607df9b07446ca45bdf754225c9bd9/tools/ideviceimagemounter.c:194: error[memleak]: Memory leak: image_sig_path
#  192|   			printf("No device found.\n");
#  193|   		}
#  194|-> 		return -1;
#  195|   	}
#  196|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
libimobiledevice-1.3.0_20230705git6fc41f5-build/libimobiledevice-6fc41f57fc607df9b07446ca45bdf754225c9bd9/tools/ideviceimagemounter.c:271:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘image_sig_path’ where non-null expected
/usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null
#  269|   		}
#  270|   		image_size = fst.st_size;
#  271|-> 		if (stat(image_sig_path, &fst) != 0) {
#  272|   			fprintf(stderr, "ERROR: stat: %s: %s\n", image_sig_path, strerror(errno));
#  273|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
libimobiledevice-1.3.0_20230705git6fc41f5-build/libimobiledevice-6fc41f57fc607df9b07446ca45bdf754225c9bd9/tools/ideviceimagemounter.c:317:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(image_path, "rb")’
#  315|   
#  316|   		char *targetname = NULL;
#  317|-> 		if (asprintf(&targetname, "%s/%s", PKG_PATH, "staging.dimage") < 0) {
#  318|   			fprintf(stderr, "Out of memory!?\n");
#  319|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libimobiledevice-1.3.0_20230705git6fc41f5-build/libimobiledevice-6fc41f57fc607df9b07446ca45bdf754225c9bd9/tools/ideviceimagemounter.c:317:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(image_path, "rb")’
#  315|   
#  316|   		char *targetname = NULL;
#  317|-> 		if (asprintf(&targetname, "%s/%s", PKG_PATH, "staging.dimage") < 0) {
#  318|   			fprintf(stderr, "Out of memory!?\n");
#  319|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
libimobiledevice-1.3.0_20230705git6fc41f5-build/libimobiledevice-6fc41f57fc607df9b07446ca45bdf754225c9bd9/tools/ideviceimagemounter.c:322:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(image_path, "rb")’
#  320|   		}
#  321|   		char *mountname = NULL;
#  322|-> 		if (asprintf(&mountname, "%s/%s", PATH_PREFIX, targetname) < 0) {
#  323|   			fprintf(stderr, "Out of memory!?\n");
#  324|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libimobiledevice-1.3.0_20230705git6fc41f5-build/libimobiledevice-6fc41f57fc607df9b07446ca45bdf754225c9bd9/tools/ideviceimagemounter.c:322:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(image_path, "rb")’
#  320|   		}
#  321|   		char *mountname = NULL;
#  322|-> 		if (asprintf(&mountname, "%s/%s", PATH_PREFIX, targetname) < 0) {
#  323|   			fprintf(stderr, "Out of memory!?\n");
#  324|   			goto leave;

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-250.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namelibimobiledevice-1.3.0^20240916gited9703d-1.fc42
diffbase-store-results-to/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.tar.xz
diffbase-time-created2024-11-13 01:25:27
diffbase-time-finished2024-11-13 01:27:34
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-250.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibimobiledevice-1.3.0^20230705git6fc41f5-5.fc41
store-results-to/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.tar.xz
time-created2024-11-13 01:22:43
time-finished2024-11-13 01:25:02
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9